import { Opt } from '__com/Opt.js'
import ruleOpt from '@/option/rule.js'
import rolesOpt from '@/option/roles.js'

export class addOpt extends Opt {
  constructor() {
    super()
  }

  create() {
    return [
      {
        title: '人员姓名',
        key: 'userName',
        placeholder: '请输入人员姓名',
        input: {
          maxlength: 10
        },
        rules: [ruleOpt.required('人员姓名不能为空')]
      },
      {
        title: '人员手机号',
        key: 'phone',
        placeholder: '请输入人员手机号',
        input: {
          maxlength: 11
        },
        rules: [ruleOpt.required('人员手机号不能为空'), ruleOpt.phone()]
      },
      rolesOpt.createSysRole({
        key: 'roleIds',
        title: '人员角色',
        multiple: true,
        rules: [ruleOpt.required('人员角色不能为空', 'array')]
      })
    ]
  }
}
